//
//  HttpTenantAction.m
//  EPBPro
//
//  Created by wucha on 2018/6/25.
//  Copyright © 2018年 fc. All rights reserved.
//

#import "HttpTenantAction.h"

@implementation HttpTenantAction
+(void)postTenantListWithAction:(TenantActionInfo*)contractActionInfo block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionSearchTenant parmasAndKeys:nil];
    NSDictionary *dic = [Utils objectToDictionary:contractActionInfo];
    [self postRequestWithRequest:requestString withParam:dic jsonSelector:@selector(getTenantListResultWithResponseData:) finish:block];
}

+(void)postAddTenantWithAction:(AddTenantActionInfo*)addContractActionInfo block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionAddTenant parmasAndKeys:nil];
    NSDictionary *dic = [Utils objectToDictionary:addContractActionInfo];
    [self postRequestWithRequest:requestString withParam:dic jsonSelector:@selector(getAddTenantResultWithResponseData:) finish:block];
    
}

+(void)putModifyTenantWithAction:(AddTenantActionInfo*)addContractActionInfo block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionModifyTenant parmasAndKeys:nil];
    NSDictionary *dic = [Utils objectToDictionary:addContractActionInfo];
    [self postRequestWithRequest:requestString withParam:dic jsonSelector:@selector(getModifyTenantResultWithResponseData:) finish:block];
    
}

+(void)getContractInfoWithID:(NSString*)contractID block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:[NSString stringWithFormat:@"%@%@",ActionSearchTenantBYID,contractID] parmasAndKeys:nil];
    [self requestWithRequest:requestString jsonParserSelector:@selector(getTenantIDResultWithResponseData:) finish:block];
    
}

+(void)deleteContractInfoWithID:(NSString*)contractID block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:[NSString stringWithFormat:@"%@%@",ActionSearchContractBYID,contractID] parmasAndKeys:nil];
    [self deleteRequestWithRequest:requestString withParam:nil jsonSelector:@selector(getTenantDeleteResultWithResponseData:) finish:block];
    
}
@end
